package com.ant.cn.base;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public abstract class BaseServlet extends HttpServlet{
	protected String TAG="";
	
	@Override
	public void init() throws ServletException {
		super.init();
		TAG=getClass().getSimpleName();
	}
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		try {
			doServlet(req, resp);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		try {
			doServlet(req, resp);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	@Override
	public void destroy() {
		super.destroy();
	}
	
	public abstract void doServlet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException ;
		

}
